/*
 * @Descripttion: 首页 或者 个人中心页面展示设备信息
 * @version: 
 * @Author:Hui
 * @Date: 2022-02-10 14:48:34
 * @LastEditTime: 2023-10-16 11:22:45
 * @LastEditors:Hui
 */


import { mapGetters } from 'vuex'

import {
  wait
} from '@/utils'

export default {
  data() {
    return {
      showProductInfo: {},
    }
  },

  computed: {
    ...mapGetters([
      'userInfo',
      'visitDeviceInfo', 'userEvaluateInfo', 'hotPhone',
    ])
  },

  methods: {
    async loadProductEvaluateInfo() {
      await wait(100)
      // 先取store中最近估价信息
      // let phone = this.userEvaluateInfo
      // if (!phone.productId && getApp().globalData.token) {
      //   phone = await this.$store.dispatch('evaluate/loaduserEvaluateInfo')
      //   console.log('最近估价======>',phone)
      // }
      
      // 取store中本机信息
      // !phone.productId && (phone = this.visitDeviceInfo)
      
      // if (!phone.productId) {
        let phone = await this.$store.dispatch('app/loadVisitDeviceInfo',{userId:this.userInfo.userId})
        // console.log('本机信息======>',phone)
      // }
      
      // // 取store中热门回收信息
      // !phone.productId && (phone = this.hotPhone)

      // if (!phone.productId) {
      //   phone = await this.$store.dispatch('evaluate/loadHotPhone')
      //   console.log('热门回收======>',phone)
      // }

      this.showProductInfo = phone
    }
  }
}